Imports DiceShenanigensUserControls

Public Class frmStart

   Private Const locationLeft As Integer = 482

   Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
      Application.Exit()
   End Sub

   Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNew.Click

      pnlNew.Left = locationLeft
      pnlNew.BringToFront()

   End Sub

   Private Sub btnOne_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOne.Click

      pnlOne.Left = locationLeft
      pnlOne.BringToFront()

   End Sub

   Private Sub btnTwo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTwo.Click

      pnlTwo.Left = locationLeft
      pnlTwo.BringToFront()

   End Sub

   Private Sub btnNewLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNewLogin.Click

      pnlNewInfo.Left = locationLeft
      pnlNewInfo.BringToFront()

   End Sub

   Private Sub btnNewBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNewBack.Click
      pnlNew.SendToBack()
   End Sub

   Private Sub btnOneBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOneBack.Click
      pnlOne.SendToBack()
   End Sub

   Private Sub btnTwoBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTwoBack.Click
      pnlTwo.SendToBack()
   End Sub

   Private Sub btnOneLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOneLogin.Click

      If checkUser(txtOneName.Text.Trim, txtOnePass.Text.Trim) = True Then

         ' Only place it should be set
         Username = txtOneName.Text.Trim

         frmConfig.setUser = userType.PvE
         pnlNew.SendToBack()
         pnlOne.SendToBack()
         pnlTwo.SendToBack()
         Me.Hide()
         frmConfig.Show()

      Else

         MsgBox("Wrong!")

      End If

   End Sub

   Private Sub btnTwoLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTwoLogin.Click

      pnlNew.SendToBack()
      pnlOne.SendToBack()
      pnlTwo.SendToBack()

      Me.Hide()
      frmConfig.Show()

      frmConfig.setUser = userType.PvP

   End Sub

   Private Sub frmStart_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

      pnlNew.SendToBack()
      pnlOne.SendToBack()
      pnlTwo.SendToBack()
      pnlNewInfo.SendToBack()

      PictureBoxLogo.BringToFront()
      pnlBeginning.BringToFront()

   End Sub

   Private Sub btnCreate_Back_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreate_Back.Click
      pnlNewInfo.SendToBack()
   End Sub

   Private Sub btnCreate_Create_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreate_Create.Click

      If createUser(txtNewName.Text.Trim, txtNewPass.Text, txtCreate_FirstName.Text, txtCreate_LastName.Text) Then

         ' Only place it should be set
         Username = txtNewName.Text.Trim

         frmConfig.setUser = userType.PvE
         pnlNew.SendToBack()
         pnlOne.SendToBack()
         pnlTwo.SendToBack()
         Me.Hide()
         frmConfig.Show()

      Else

      End If

   End Sub

End Class